package com.jnevision.personalattendance.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.jnevision.util.JsonMapper;

/**
 * <p>
 * 人员考勤
 * </p>
 *
 * @author gavin
 * @since 2019-07-21
 */
@TableName("b_personal_attendance")
public class PersonalAttendance extends Model<PersonalAttendance> {
    private static final long serialVersionUID = -5077485534833793682L;

    @TableId(value = "id", type = IdType.UUID)
    private String id;

    /**
     * 考勤组
     */
    @TableField("group_id")
    private Integer groupId;

    /**
     * 用户id
     */
    @TableField("user_id")
    private String userId;

    /**
     * 手机号
     */
    @TableField("phone")
    private String phone;

    /**
     * 排班日期
     */
    @TableField("day1")
    private String day1;

    /**
     * 同上
     */
    @TableField("day2")
    private String day2;

    @TableField("day3")
    private String day3;

    @TableField("day4")
    private String day4;

    @TableField("day5")
    private String day5;

    @TableField("day6")
    private String day6;

    @TableField("day7")
    private String day7;

    @TableField("day8")
    private String day8;

    @TableField("day9")
    private String day9;

    @TableField("day10")
    private String day10;

    @TableField("day11")
    private String day11;

    @TableField("day12")
    private String day12;

    @TableField("day13")
    private String day13;

    @TableField("day14")
    private String day14;

    @TableField("day15")
    private String day15;

    @TableField("day16")
    private String day16;

    @TableField("day17")
    private String day17;

    @TableField("day18")
    private String day18;

    @TableField("day19")
    private String day19;

    @TableField("day20")
    private String day20;

    @TableField("day21")
    private String day21;

    @TableField("day22")
    private String day22;

    @TableField("day23")
    private String day23;

    @TableField("day24")
    private String day24;

    @TableField("day25")
    private String day25;

    @TableField("day26")
    private String day26;

    @TableField("day27")
    private String day27;

    @TableField("day28")
    private String day28;

    @TableField("day29")
    private String day29;

    @TableField("day30")
    private String day30;

    @TableField("day31")
    private String day31;

    @TableField(exist = false)
    private String userName;

    @TableField(exist = false)
    private String[] days = new String[31];

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String[] getDays() {
        return this.days;
    }

    public void setDays(String[] days) {
        System.err.println(JsonMapper.nonDefaultMapper().toJson(days));
        this.day1 = days[0];
        this.day2 = days[1];
        this.day3 = days[2];
        this.day4 = days[3];
        this.day5 = days[4];
        this.day6 = days[5];
        this.day7 = days[6];
        this.day8 = days[7];
        this.day9 = days[8];
        this.day10 = days[9];
        this.day11 = days[10];
        this.day12 = days[11];
        this.day13 = days[12];
        this.day14 = days[13];
        this.day15 = days[14];
        this.day16 = days[15];
        this.day17 = days[16];
        this.day18 = days[17];
        this.day19 = days[18];
        this.day20 = days[19];
        this.day21 = days[20];
        this.day22 = days[21];
        this.day23 = days[22];
        this.day24 = days[23];
        this.day25 = days[24];
        this.day26 = days[25];
        this.day27 = days[26];
        this.day28 = days[27];
        this.day29 = days[28];
        this.day30 = days[29];
        this.day31 = days[30];
        this.days = days;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getDay1() {
        return day1;
    }

    public void setDay1(String day1) {
        this.days[0] = day1;
        this.day1 = day1;
    }

    public String getDay2() {
        return day2;
    }

    public void setDay2(String day2) {
        this.days[1] = day2;
        this.day2 = day2;
    }

    public String getDay3() {
        return day3;
    }

    public void setDay3(String day3) {
        this.days[2] = day3;
        this.day3 = day3;
    }

    public String getDay4() {
        return day4;
    }

    public void setDay4(String day4) {
        this.days[3] = day4;
        this.day4 = day4;
    }

    public String getDay5() {
        return day5;
    }

    public void setDay5(String day5) {
        this.days[4] = day5;
        this.day5 = day5;
    }

    public String getDay6() {
        return day6;
    }

    public void setDay6(String day6) {
        this.days[5] = day6;
        this.day6 = day6;
    }

    public String getDay7() {
        return day7;
    }

    public void setDay7(String day7) {
        this.days[6] = day7;
        this.day7 = day7;
    }

    public String getDay8() {
        return day8;
    }

    public void setDay8(String day8) {
        this.days[7] = day8;
        this.day8 = day8;
    }

    public String getDay9() {
        return day9;
    }

    public void setDay9(String day9) {
        this.days[8] = day9;
        this.day9 = day9;
    }

    public String getDay10() {
        return day10;
    }

    public void setDay10(String day10) {
        this.days[9] = day10;
        this.day10 = day10;
    }

    public String getDay11() {
        return day11;
    }

    public void setDay11(String day11) {
        this.days[10] = day11;
        this.day11 = day11;
    }

    public String getDay12() {
        return day12;
    }

    public void setDay12(String day12) {
        this.days[11] = day12;
        this.day12 = day12;
    }

    public String getDay13() {
        return day13;
    }

    public void setDay13(String day13) {
        this.days[12] = day13;
        this.day13 = day13;
    }

    public String getDay14() {
        return day14;
    }

    public void setDay14(String day14) {
        this.days[13] = day14;
        this.day14 = day14;
    }

    public String getDay15() {
        return day15;
    }

    public void setDay15(String day15) {
        this.days[14] = day15;
        this.day15 = day15;
    }

    public String getDay16() {
        return day16;
    }

    public void setDay16(String day16) {
        this.days[15] = day16;
        this.day16 = day16;
    }

    public String getDay17() {
        return day17;
    }

    public void setDay17(String day17) {
        this.days[16] = day17;
        this.day17 = day17;
    }

    public String getDay18() {
        return day18;
    }

    public void setDay18(String day18) {
        this.days[17] = day18;
        this.day18 = day18;
    }

    public String getDay19() {
        return day19;
    }

    public void setDay19(String day19) {
        this.days[18] = day19;
        this.day19 = day19;
    }

    public String getDay20() {
        return day20;
    }

    public void setDay20(String day20) {
        this.days[19] = day20;
        this.day20 = day20;
    }

    public String getDay21() {
        return day21;
    }

    public void setDay21(String day21) {
        this.days[20] = day21;
        this.day21 = day21;
    }

    public String getDay22() {
        return day22;
    }

    public void setDay22(String day22) {
        this.days[21] = day22;
        this.day22 = day22;
    }

    public String getDay23() {
        return day23;
    }

    public void setDay23(String day23) {
        this.days[22] = day23;
        this.day23 = day23;
    }

    public String getDay24() {
        return day24;
    }

    public void setDay24(String day24) {
        this.days[23] = day24;
        this.day24 = day24;
    }

    public String getDay25() {
        return day25;
    }

    public void setDay25(String day25) {
        this.days[24] = day25;
        this.day25 = day25;
    }

    public String getDay26() {
        return day26;
    }

    public void setDay26(String day26) {
        this.days[25] = day26;
        this.day26 = day26;
    }

    public String getDay27() {
        return day27;
    }

    public void setDay27(String day27) {
        this.days[26] = day27;
        this.day27 = day27;
    }

    public String getDay28() {
        return day28;
    }

    public void setDay28(String day28) {
        this.days[27] = day28;
        this.day28 = day28;
    }

    public String getDay29() {
        return day29;
    }

    public void setDay29(String day29) {
        this.days[28] = day29;
        this.day29 = day29;
    }

    public String getDay30() {
        return day30;
    }

    public void setDay30(String day30) {
        this.days[29] = day30;
        this.day30 = day30;
    }

    public String getDay31() {
        return day31;
    }

    public void setDay31(String day31) {
        this.days[30] = day31;
        this.day31 = day31;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "PersonalAttendance{" + "id=" + id + ", groupId=" + groupId + ", userId=" + userId + ", phone=" + phone
            + ", day1=" + day1 + ", day2=" + day2 + ", day3=" + day3 + ", day4=" + day4 + ", day5=" + day5 + ", day6="
            + day6 + ", day7=" + day7 + ", day8=" + day8 + ", day9=" + day9 + ", day10=" + day10 + ", day11=" + day11
            + ", day12=" + day12 + ", day13=" + day13 + ", day14=" + day14 + ", day15=" + day15 + ", day16=" + day16
            + ", day17=" + day17 + ", day18=" + day18 + ", day19=" + day19 + ", day20=" + day20 + ", day21=" + day21
            + ", day22=" + day22 + ", day23=" + day23 + ", day24=" + day24 + ", day25=" + day25 + ", day26=" + day26
            + ", day27=" + day27 + ", day28=" + day28 + ", day29=" + day29 + ", day30=" + day30 + ", day31=" + day31
            + "}";
    }
}